.class final Lnbisdk/q;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/gd;


# instance fields
.field private D:Lnbisdk/ap;

.field private E:Lnbisdk/is;

.field private d:Lnbisdk/ov;


# direct methods
.method constructor <init>(ILnbisdk/ap;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/32 v0, 0x2000000

    invoke-static {v0, v1}, Lnbisdk/pn;->k(J)Lnbisdk/ov;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    iput-object p2, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    new-instance v0, Lnbisdk/is;

    invoke-direct {v0, p1}, Lnbisdk/is;-><init>(I)V

    iput-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    invoke-direct {p0}, Lnbisdk/q;->A()V

    return-void
.end method

.method private A()V
    .locals 5

    :try_start_0
    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lnbisdk/ap;->a(Lnbisdk/jt;)Lnbisdk/cl;

    move-result-object v0

    if-eqz v0, :cond_2

    :cond_0
    :goto_0
    invoke-interface {v0}, Lnbisdk/cl;->cj()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v0}, Lnbisdk/cl;->ci()I

    move-result v1

    iget-object v2, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v2, v1}, Lnbisdk/ap;->B(I)[B

    move-result-object v2

    if-eqz v2, :cond_0

    array-length v3, v2

    if-lez v3, :cond_0

    invoke-static {v2}, Lnbisdk/nz;->r([B)Lnbisdk/bd;

    move-result-object v2

    iget-object v3, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v2, v2, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v3, v1, v2}, Lnbisdk/is;->a(ILjava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    iget-object v1, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    const-string v2, "DBCache cannot be initizled"

    invoke-virtual {v1, v2}, Lnbisdk/ov;->ay(Ljava/lang/String;)V

    iget-object v1, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    invoke-virtual {v1, v0}, Lnbisdk/ov;->b(Ljava/lang/Throwable;)V

    :cond_1
    return-void

    :cond_2
    :try_start_1
    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v0}, Lnbisdk/ap;->aK()I

    move-result v0

    const/4 v1, 0x1

    :goto_1
    if-gt v1, v0, :cond_1

    iget-object v2, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v2, v1}, Lnbisdk/ap;->B(I)[B

    move-result-object v2

    if-eqz v2, :cond_3

    array-length v3, v2

    if-lez v3, :cond_3

    invoke-static {v2}, Lnbisdk/nz;->r([B)Lnbisdk/bd;

    move-result-object v2

    iget-object v3, p0, Lnbisdk/q;->E:Lnbisdk/is;

    const/4 v4, 0x0

    iget-object v2, v2, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v3, v4, v2}, Lnbisdk/is;->a(ILjava/lang/String;)Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    :cond_3
    add-int/lit8 v1, v1, 0x1

    goto :goto_1
.end method


# virtual methods
.method public final a(Ljava/lang/String;)Lnbisdk/bd;
    .locals 4

    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    invoke-virtual {v0, p1}, Lnbisdk/is;->ac(Ljava/lang/String;)Lnbisdk/is$b;

    move-result-object v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    :try_start_0
    iget-object v2, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v0}, Lnbisdk/is$b;->jW()I

    move-result v0

    invoke-virtual {v2, v0}, Lnbisdk/ap;->B(I)[B

    move-result-object v0

    if-eqz v0, :cond_1

    array-length v2, v0

    if-lez v2, :cond_1

    iget-object v2, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    const-string v3, "DBCache.get hit"

    invoke-virtual {v2, v3}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    invoke-static {v0}, Lnbisdk/nz;->r([B)Lnbisdk/bd;
    :try_end_0
    .catch Lnbisdk/an; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    iget-object v2, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    invoke-virtual {v2, v0}, Lnbisdk/ov;->b(Ljava/lang/Throwable;)V

    move-object v0, v1

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    const-string v2, "DBCache.get miss"

    invoke-virtual {v0, v2}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    :cond_1
    move-object v0, v1

    goto :goto_0
.end method

.method public final a(Lnbisdk/bd;)V
    .locals 6

    const/4 v4, -0x1

    :try_start_0
    iget-object v0, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    const-string v1, "DBCache.put "

    invoke-virtual {v0, v1}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    invoke-static {p1}, Lnbisdk/nz;->b(Lnbisdk/bd;)[B

    move-result-object v2

    iget-object v0, p1, Lnbisdk/bd;->cu:Ljava/lang/Object;

    if-eqz v0, :cond_0

    if-nez v2, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v1, p1, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lnbisdk/is;->ac(Ljava/lang/String;)Lnbisdk/is$b;

    move-result-object v1

    if-nez v1, :cond_4

    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v0, v0, Lnbisdk/is;->mp:Lnbisdk/oo;

    invoke-virtual {v0}, Lnbisdk/oo;->isFull()Z

    move-result v0

    if-eqz v0, :cond_3

    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v1, v0, Lnbisdk/is;->mp:Lnbisdk/oo;

    invoke-virtual {v1}, Lnbisdk/oo;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_5

    iget-object v1, v0, Lnbisdk/is;->mp:Lnbisdk/oo;

    invoke-virtual {v1}, Lnbisdk/oo;->jN()Lnbisdk/is$b;

    move-result-object v1

    iget-object v0, v0, Lnbisdk/is;->mq:Lnbisdk/is$a;

    invoke-virtual {v1}, Lnbisdk/is$b;->getKey()Ljava/lang/String;

    move-result-object v3

    iget-object v0, v0, Lnbisdk/is$a;->tE:Ljava/util/Hashtable;

    invoke-virtual {v0, v3}, Ljava/util/Hashtable;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v1}, Lnbisdk/is$b;->jW()I

    move-result v0

    move v1, v0

    :goto_1
    if-eq v1, v4, :cond_2

    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    const/4 v3, 0x0

    array-length v4, v2

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Lnbisdk/ap;->a(I[BIIZ)V

    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v2, p1, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lnbisdk/is;->a(ILjava/lang/String;)Z

    :cond_2
    :goto_2
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_0

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget-object v1, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v1, v1, Lnbisdk/is;->mp:Lnbisdk/oo;

    invoke-virtual {v1}, Lnbisdk/oo;->size()I

    move-result v1

    iput v1, v0, Lnbisdk/kh;->pm:I
    :try_end_0
    .catch Lnbisdk/an; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    iget-object v1, p0, Lnbisdk/q;->d:Lnbisdk/ov;

    invoke-virtual {v1, v0}, Lnbisdk/ov;->b(Ljava/lang/Throwable;)V

    goto :goto_0

    :cond_3
    if-eqz v2, :cond_2

    :try_start_1
    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    const/4 v1, 0x0

    array-length v3, v2

    const/4 v4, 0x0

    invoke-virtual {v0, v2, v1, v3, v4}, Lnbisdk/ap;->a([BIIZ)I

    move-result v0

    iget-object v1, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v2, p1, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v1, v0, v2}, Lnbisdk/is;->a(ILjava/lang/String;)Z

    goto :goto_2

    :cond_4
    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v1}, Lnbisdk/is$b;->jW()I

    move-result v1

    const/4 v3, 0x0

    array-length v4, v2

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Lnbisdk/ap;->a(I[BIIZ)V
    :try_end_1
    .catch Lnbisdk/an; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2

    :cond_5
    move v1, v4

    goto :goto_1
.end method

.method public final clear()V
    .locals 2

    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v0}, Lnbisdk/ap;->aJ()V

    const-string v0, "comnimtm"

    invoke-static {v0}, Lnbisdk/ap;->h(Ljava/lang/String;)V

    iget-object v0, p0, Lnbisdk/q;->E:Lnbisdk/is;

    iget-object v1, v0, Lnbisdk/is;->mp:Lnbisdk/oo;

    invoke-virtual {v1}, Lnbisdk/oo;->clear()V

    iget-object v0, v0, Lnbisdk/is;->mq:Lnbisdk/is$a;

    iget-object v0, v0, Lnbisdk/is$a;->tE:Ljava/util/Hashtable;

    invoke-virtual {v0}, Ljava/util/Hashtable;->clear()V

    return-void
.end method

.method public final close()V
    .locals 1

    iget-object v0, p0, Lnbisdk/q;->D:Lnbisdk/ap;

    invoke-virtual {v0}, Lnbisdk/ap;->aJ()V

    return-void
.end method
